package com.gack.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.gack.business.model.StoreAndService;

/**
 * 
* @ClassName: StoreAndServiceRepository 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author (ZhangXinYu)  
* @date 2018年6月5日 下午3:54:36 
* @version V1.0
 */
public interface StoreAndServiceRepository extends JpaRepository<StoreAndService, String>{
	@Query("select s.serviceid from StoreAndService s where s.storeid = :storeid")
	public List<String> getAllStoreServiceids(@Param("storeid")String storeid);
	
	//删除指定门店对应的配套服务
	@Transactional
	@Modifying
	@Query("DELETE FROM StoreAndService ss where ss.storeid = :storeid")
	public Integer dealStoreServiceByStoreid(@Param("storeid") String storeid);
}
